<?php

$func_name = "cat_get_root.php";

log_message('[' . $func_name . ']' . "");

$return_categories = array();
$root_categories = get_level_categories();
foreach ($root_categories as $cat_id => $cat_name) {
    $categorie['cat_id'] = $cat_id;
    $categorie['cat_name'] = $cat_name;
    array_push($return_categories, $categorie);
}

$to_tpl = array();
$to_tpl["filename"] = 'output_json.tpl';
$to_tpl["data"] = array();
$to_tpl['data'] = $return_categories;

unset($func_name);

return $to_tpl;
?>